package com.guchenbo.spark.sql

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.types.{DoubleType, IntegerType, StringType, StructField, StructType}

/**
 * @author guchenbo
 * @date 2022/2/18
 */
object Demo {
  def main(args: Array[String]): Unit = {
    var fields = List[StructField](StructField("id", IntegerType), StructField("name", StringType))
    var fields2 = List[StructField](StructField("id", DoubleType), StructField("name", StringType))
    var fields3 = List[StructField](StructField("id", IntegerType), StructField("name", StringType), StructField("c", IntegerType))

    val schema = StructType(fields)

    val schema2 = StructType(fields2)
    val schema3 = StructType(fields3)


    println(schema == schema2)
    println(schema == schema3)
    println(schema)

    import org.apache.spark.executor.OutputMetrics
  }
}
